/*
 * Singularity Engine
 * Copyright (C) 2010 Vyacheslav Vorobyov, All rights reserved.
 * See LICENSE for full license information.
 */

/**
 * 
 */
package org.singularity.mapred;

import org.singularity.io.DME;
import org.singularity.io.Pipe;

/**
 * This interface is used to specify a function that 
 * is responsible for mapping values (scalar stream) 
 * to a key-value pairs (vector stream).
 *  
 * @author vjache
 *
 * @param <VT> - a type of a value to be mapped.
 * @param <KT> - a type of a key of a key-value pair.
 * @param <VT1> - a type of a value of a key-value pair.
 */
public interface MapFun<VT,KT,VT1> {
	/**
	 * A map function to map scalar stream on vector stream.
	 * @param aEvent - a value wrapped to a data modification 
	 * event (DME).
	 * @param aOutput - a pipe accepting a key-value pairs 
	 * wrapped to a vectorized data modification event(VDME).
	 * 
	 * @throws Exception
	 * 
	 * @see DME
	 * @see VDME
	 */
	void map(DME<VT> aEvent, Pipe<VDME<KT,VT1>> aOutput) throws Exception;
}
